<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>

    <script>
        // 需求：一个学生数据，拼接成表格
        let student = { name: '张三', age: 18, gender: '男' };
        // ES6 拼接成表格行数据
        let rowHtmlES6 = `<table border=1>
        <tr><th>姓名</th><th>年龄</th><th>性别</th></tr>
        <tr>
            <td>${student.name}</td>
            <td>${student.age}</td>
            <td>${student.gender}</td>
        </tr>
        </table>`;
        window.onload = function(){
        document.body.innerHTML = rowHtmlES6;
    }
</script>
</head>
<body>
    
</body>
</html>